﻿Imports omen02
Public Class InsertarVenta

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
        Me.Visible = False
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click


        'Ingresar los datos a la base de datos

        Dim x = Me.idpedidoregistrarventa.Text

        Dim y = Me.idpaqueteregistrarventa.Text

        Dim z = Me.fventaregistrarventa.Text

        Dim a = Me.finstalacionregistrarventa.Text

        Dim b = Me.fgarantiaregistrarventa.Text

        Dim n = New VentaNegocio()


        Dim paquete = n.insertar(x, y, z, a, b)

        MsgBox("Pedido registrado!!!!")

        'Limpiar cajitas de texto desues de ingresar datos
        idpedidoregistrarventa.Clear()
        idpaqueteregistrarventa.Clear()

    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'solo Listar ventas

        Dim negocio As New VentaNegocio
        Dim ventas As Collection = negocio.listar()
        Me.dgvpaquete.DataSource = ventas
        Me.dgvpaquete.EditMode = False

        Me.dgvpaquete.Columns(0).HeaderText = "idVenta"
        Me.dgvpaquete.Columns(1).HeaderText = "idPedido"
        Me.dgvpaquete.Columns(2).HeaderText = "idPaquete"
        Me.dgvpaquete.Columns(3).HeaderText = "fecha_venta"
        Me.dgvpaquete.Columns(4).HeaderText = "fecha_instalacion"
        Me.dgvpaquete.Columns(5).HeaderText = "fecha_garantia"

    End Sub

    Private Sub dgvventa_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvpaquete.CellContentClick

    End Sub

    Private Sub InsertarVenta_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class